/* GUI CONVERTED from rewoiq.p (converter v1.76) Wed Dec  5 09:39:50 2001 */
/* rewoiq.p - WORK ORDER INQUIRY wo_type = "C" REPETITIVE CUMULATION ORDER    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.7.1.3 $                                                       */
/*V8:ConvertMode=Report                                                       */
/* REVISION: 1.0      LAST MODIFIED: 04/15/86   BY: PML                       */
/* REVISION: 1.0      LAST MODIFIED: 05/07/86   BY: EMB                       */
/* REVISION: 2.1      LAST MODIFIED: 09/10/87   BY: WUG *A94*                 */
/* REVISION: 4.0      LAST EDIT:     12/30/87   BY: WUG *A137*                */
/* REVISION: 5.0      LAST EDIT:     05/03/89   BY: WUG *B098*                */
/* REVISION: 6.0      LAST MODIFIED: 09/25/90   BY: SMM *D072*                */
/* REVISION: 6.0      LAST MODIFIED: 11/20/90   BY: emb *D223*                */
/* Revision: 7.3      Last edit:     11/19/92   By: jcd *G339*                */
/* Revision: 7.3      Last edit:     08/10/94   By: pxd *GL21*                */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/*                                   08/27/94   BY: bcm *GL62*                */
/* REVISION: 8.6E     LAST MODIFIED: 02/27/98   BY: *K1K8* Beena Mol          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 06/03/98   BY: *K1RW* A.Shobha           */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown         */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Old ECO marker removed, but no ECO header exists *F230*                    */
/* $Revision: 1.7.1.3 $    BY: Jean Miller           DATE: 12/05/01  ECO: *P039*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* DISPLAY TITLE          */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "b+ "}

define variable nbr    like wo_nbr label "W/O #".
define variable lot    like wo_lot.
define variable due    like wo_due_date.
define variable so_job like wo_so_job.
define variable part   like pt_part.
define variable site   like rps_site.
define variable prline like rps_line.

assign
   part = global_part
   site = global_site.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
space(1)
   part    colon 13
   nbr     colon 40
   lot     colon 64
   site    colon 13
   prline  colon 40
   so_job  colon 64
with frame a side-labels no-underline width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

{wbrp01.i}

repeat:

   if c-application-mode <> 'web' then
      update part nbr lot  site prline so_job with frame a
   editing:

      if frame-field = "part" then do:
         /* FIND NEXT/PREVIOUS RECORD */
         {mfnp05.i wo_mstr wo_type_part "wo_type = ""C""" wo_part part}
         if recno <> ? then do:
            part = wo_part.
            display part with frame a.
            recno = ?.
         end.
      end.
      else if frame-field = "nbr" then do:
         /* FIND NEXT/PREVIOUS RECORD */
         {mfnp05.i wo_mstr wo_type_nbr "wo_type = ""C""" wo_nbr nbr}
         if recno <> ? then do:
            nbr = wo_nbr.
            display nbr with frame a.
            recno = ?.
         end.
      end.
      else if frame-field = "site" then do:
         /* FIND NEXT/PREVIOUS RECORD */
         {mfnp.i si_mstr site si_site site si_site si_site}
         if recno <> ? then do:
            display si_site @ site with frame a.
         end.
      end.
      else if frame-field = "prline" then do:
         /* FIND/NEXT PREVIOUS RECORD */
         {mfnp.i ln_mstr site ln_site prline ln_line ln_line}
         if recno <> ? then do:
            display ln_site @ site ln_line @ prline with frame a.
         end.
      end.
      else do:
         status input.
         readkey.
         apply lastkey.
      end.

   end.

   {wbrp06.i &command = update &fields = "  part nbr lot site
        prline so_job" &frm = "a"}

   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data'))
   then do:
      hide frame b.
      hide frame c.
      hide frame d.
      hide frame e.
      hide frame f.
      hide frame g.
      hide frame h.
   end.

   /* OUTPUT DESTINATION SELECTION */
   {gpselout.i &printType = "terminal"
               &printWidth = 80
               &pagedFlag = " "
               &stream = " "
               &appendToFile = " "
               &streamedOutputToTerminal = " "
               &withBatchOption = "no"
               &displayStatementType = 1
               &withCancelMessage = "yes"
               &pageBottomMargin = 6
               &withEmail = "yes"
               &withWinprint = "yes"
               &defineVariables = "yes"}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


   /* FIND AND DISPLAY */
   if part <> "" then
   for each wo_mstr where wo_type = "C"
         and (wo_part = part)
         and (wo_lot = lot or lot = "" )
         and (wo_nbr = nbr or nbr = "" )
         and (wo_so_job = so_job or so_job = "" )
         and (wo_site = site or site = "")
         and (wo_line = prline or prline = "")
   no-lock with frame b width 80 no-attr-space:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).

      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      display
         wo_part
         wo_nbr
         wo_lot
         wo_qty_comp
         wo_so_job
         wo_status WITH STREAM-IO /*GUI*/ .

   end.

   else if nbr <> "" then
   for each wo_mstr where wo_type = "C"
         and (wo_nbr = nbr)
         and (wo_lot = lot or lot = "" )
         and (wo_so_job = so_job or so_job = "" )
         and (wo_site = site or site = "")
         and (wo_line = prline or prline = "")
   no-lock with frame c width 80 no-attr-space:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame c:handle).

      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      display
         wo_part
         wo_nbr
         wo_lot
         wo_qty_comp
         wo_so_job
         wo_status WITH STREAM-IO /*GUI*/ .

   end.

   else if lot <> "" then
   for each wo_mstr where wo_type = "C"
         and (wo_lot = lot)
         and (wo_so_job = so_job or so_job = "" )
         and (wo_site = site or site = "")
         and (wo_line = prline or prline = "")
   no-lock with frame d width 80 no-attr-space:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame d:handle).

      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      display
         wo_part
         wo_nbr
         wo_lot
         wo_qty_comp
         wo_so_job
         wo_status WITH STREAM-IO /*GUI*/ .

   end.

   else if so_job <> "" then
   for each wo_mstr where wo_type = "C"
         and wo_so_job = so_job
         and (wo_site = site or site = "")
         and (wo_line = prline or prline = "")
   no-lock with frame e width 80 no-attr-space:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame e:handle).

      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      display
         wo_part
         wo_nbr
         wo_lot
         wo_qty_comp
         wo_so_job
         wo_status WITH STREAM-IO /*GUI*/ .

   end.

   else if site <> "" then
   for each wo_mstr where wo_type = "C" and
         wo_site = site
         and (wo_line = prline or prline = "") no-lock
   with frame g width 80 no-attr-space:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame g:handle).

      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      display
         wo_part
         wo_nbr
         wo_lot
         wo_qty_comp
         wo_so_job
         wo_status WITH STREAM-IO /*GUI*/ .

   end.

   else if prline <> "" then
   for each wo_mstr where wo_type = "C" and wo_line = prline no-lock
   with frame h width 80 no-attr-space:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame h:handle).

      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      display
         wo_part
         wo_nbr
         wo_lot
         wo_qty_comp
         wo_so_job
         wo_status WITH STREAM-IO /*GUI*/ .
   end.

   else
   for each wo_mstr where wo_type = "C"
   no-lock with frame f width 80 no-attr-space:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame f:handle).

      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      display
         wo_part
         wo_nbr
         wo_lot
         wo_qty_comp
         wo_so_job
         wo_status WITH STREAM-IO /*GUI*/ .

   end.

   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {pxmsg.i &MSGNUM=8 &ERRORLEVEL=1}

end.

assign
   global_part = part
   global_site = site.

{wbrp04.i &frame-spec = a}
